﻿using AutoMapper;
using Domain.Entity;
using Domain.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AppService.CM2Service
{
    public class CM2Service : ICM2Service
    {
        private readonly IMapper mapper;
        public ICM2Repository CM2Repository { get; set; }


        public CM2Service(IMapper mapper, ICM2Repository CM2Repository)
        {
            this.mapper = mapper;
            this.CM2Repository = CM2Repository;

        }
        public Task<int> AddCM2(CM cM)
        {
           return CM2Repository.AddCM2(cM);
        }

        public Task<int> DeleteCM2(int id)
        {
            return CM2Repository.DeleteCM2(id);
        }

        public List<CM> GetCM2()
        {
            return CM2Repository.GetCM2();
        }

		public List<CM> CMName(string name)
		{
			return CM2Repository.CMName(name);
		}
	}
}
